-
Notifications
You must be signed in to change notification settings - Fork 4.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Blocks: Adds check for parent before showing convert to pattern button #66158
Conversation
The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. You can also manually ask me to refresh this list by adding the If you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message.
To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook. |
That looks like a reasonable fix to me. I would feel more confident landing this change if we had an e2e test covering it. That's said I will test it manually. |
I thought the plan was to set this at the block registration level. Or would that be too unexpected for consumers? |
That is also a possibility. However, the logic used here mostly impacts how the default value is computed. If the block explicitly defines support for |
Is there something more to address in order to land? This seems a good approach and ready. |
Hi @gziolo, just checking in—please let me know if there's anything pending from my side to get this PR landed. Thanks! |
All good, landed 👍🏻 |
What?
Fixes: #35223
Why?
When a block defines a
parent
it was still possible to select the "child" block and make it reusable.How?
This PR adds a check for "parent" type before showing the "convert to patterns" (reusable). It adds the default value of reusable support to false if not defined in the block supports.
Testing Instructions
true
in Child Block's block.jsonScreenshots
Default State (Without adding reusable key in support)
After defining reusable as true